packages_to_check <- c("stars", "httr", "jsonlite", "tmap", "basemaps", "sp", "sf")
# Check and install packages
for (package_name in packages_to_check) {
if (!package_name %in% rownames(installed.packages())) {
install.packages(package_name)
cat(paste("Package", package_name, "installed.\n"))
} else {
cat(paste("Package", package_name, "is already installed.\n"))
}
library(package_name, character.only = TRUE)
}
#in case tmap does not install
#remotes::install_github('r-tmap/tmap')MODIS NRT Global Flood Product
LANCE MODIS Near Real Time (NRT) Global Flood Product
Overview
In this lesson, you will use R to take a closer look at the data from the LANCE MODIS Near Real Time (NRT) Global Flood Product, including learning about what are LANCE and MODIS, and the NRT Flood products available. You will then learn to select, download, and visualize one of the NRT Flood layers…
This lesson uses the R language and environment. R is a popular language used for statistical computing and graphics.
Learning Objectives
After completing this lesson, you should be able to:
Determine what NRT raster data is available by navigating the LANCE website.
Read a tile map and select a raster tile to download based on a point of interest.
Download near-real-time raster data using the application programming interfaces (APIs) with the GET HTTP request method (Wilson 2024).
View the downloaded raster data to quickly preview.
Classify and place on a map the NRT flood raster data to determine areas with unusual flooding.
Introduction
Atmospheric circulation, water evaporation, and their interactions with land surfaces can impact a region’s rainfall variability. For example, California’s winter is correlated to ocean evaporation near the west coast and eastern North Pacific, and ocean evaporation is a strong factor in increased flooding in the region (Wei et al. 2016). Additionally, drought in the region is associated to high pressure systems off the U.S. west coast, with studies finding that the high pressure system is linked to the Pacific sea surface temperature anomalies, and exacerbated by high evaporation over land due to high temperatures.
It is critical to understand the water cycle and how flooding events develop, particularly as climate change intensifies extreme weather events, because the impacts of flooding can be a risk to human life, and can disrupt infrastructure, agriculture, and natural habitats.
The MODIS/Aqua+Terra Global Flood Product L3 Near Real Time (NRT) 250m Global Flood Product (MCDWD_L3_NRT) (beta) provides daily maps of flooding globally. The product is provided over 3 compositing periods (1-day, 2-day, and 3-day) to minimize the impact of clouds and more rigorously identify flood water (the best composite will depend on the cloudiness for a particular event) (Lin et al. 2019)
What are MODIS and LANCE?
MODIS
The Moderate Resolution Imaging Spectroradiometer (MODIS) is a NASA Earth Observing System (EOS) satellite-based sensor system that creates data products including land surface temperatures, land surface reflectance, radiances, clouds, aerosols, water vapor, active fire, snow cover, sea ice measurements, and other factor information. The MODIS Near Real-Time (NRT) data includes the Flood product which is a daily ~250 m resolution product showing flood and surface water detected from the twice-daily overpass of the MODIS optical sensors.
The satellite data is readily available shortly after it is acquired by the MODIS instrument on board the Terra and Aqua satellites. This space-based instrument distinguishes 36 spectral bands and groups of wavelengths which helps map the extent of snow and ice caused by winter storms and frigid temperatures. Initially, the water-detecting algorithm is applied to both MODIS observations (Terra and Aqua). Due to cloud and terrain shadows create false positives.
To minimize errors, the product is generated with three different compositing periods (1-day, 2-day, and 3-day) to compare results and decide which product has better coverage for the event. Further, they have to differentiate floods from expected surface water through the use of MODIS Land Water Mask (MOD44W), which uses a decision tree classifier trained with MODIS data to produce a global water mask (Carroll et al. 2016).
MODIS adoption aimed to surpass barriers related to satellite data, including cost, delivery timelines, limited formats, and the need for technical expertise. The transition to GFIMS establishes an operational system at FAO, ensuring continuity in meeting NASA data-user needs (Lin et al. 2019).
LANCE
The Land, Atmosphere Near Real-time Capability for EOS (LANCE) is a NASA initiative that provides near real-time access to satellite data, including MODIS. It allows users to access the latest data within a few hours of satellite overpass, enabling rapid responses to environmental events such as floods. LANCE is particularly valuable for emergency response teams and researchers who require up-to-date information for monitoring and assessing natural disasters (Land 2024).
LANCE reduces processing time, allowing for timely computation. Users access the data through platforms like Web Map Service (WMS) and Web Coverage Service (WCS), enabling visualization and analysis for informed decision-making. This NRT approach enhances the speed and accessibility of critical information on vegetation conditions (Zhang et al. 2022).
MODIS NRT Flood MCDWD Data Products
The main landing pages for the MODIS NRT Global Flood Product:
The MODIS/Terra+Aqua Combined MODIS Water Detection (MCDWD) algorithm is tailor-made for detecting water bodies using MODIS data obtained from both the Terra and Aqua satellites. This algorithm employs various bands and spectral information to effectively identify and categorize water bodies. This enhances the accuracy and reliability of the flood product generated (Slayback 2023).
The MODIS Near Real-Time (NRT) Flood dataset offers multiple products, each accompanied by corresponding layers. The specific layers depend on the temporal aggregation:
MCDWD_F1_L3_NRT (1-Day product) This product type is the most basic level and provides binary information about water occurrence. Pixels are classified as either containing water or not, offering a simple way to identify flooded areas.
MCDWD_F1CS_L3_NRT (1-Day CS): F1CS has a cloud shadow mask applied on the version of the MCDWD_F1_L3_NRT product
MCDWD_F2_L3_NRT (2-Day): F2 provides additional information by categorizing water occurrences into three categories: no water, low-confidence water, and high-confidence water. This classification allows for a more nuanced understanding of the extent of the flood and its associated confidence levels.
MCDWD_F3_L3_NRT (3-Day): The F3 product, based on the MCDWD (MODIS/Terra+Aqua Combined MODIS Water Detection) is an algorithm that further refines flood mapping by adding additional spectral information. These results create a more accurate representation of water bodies and flooded areas (Slayback 2023).
Exploring the Data
For this exercise, we will be using the MCDWD L3 F3 product: LANCE NRT Flood
First, install and load the R packages required for this exercise:
Check what days are available for the MCDWD L3 F3 product by going to this link: LANCE NRT Primary Server or Secondary.
Based on availability, edit the year_day variable YYYY-DD. Example: ‘2022-01’
#add the year and date you want to search for (YYYY-DD, 2022-01)
year_day <- '2024-102'Determine tiles of interest:
Based on availability, edit the tile_code variable:
#add tile code from the map above (written as h00v00)
tile_code <- 'h05v05'This is the NRT Flood F3 (MCDWD_L3_F3) API URL:
# Primary Server
API_URL <- paste0('https://nrt3.modaps.eosdis.nasa.gov/api/v2/content/details?products=MCDWD_L3_F3_NRT&archiveSets=61&temporalRanges=')
# if the primary server is down, the secondary server may be available:
#API_URL <- paste0('https://nrt4.modaps.eosdis.nasa.gov/api/v2/content/details?products=MCDWD_L3_F3_NRT&archiveSets=61&temporalRanges=')We can combine the API URL above with the year_day provided and print the available datasets:
#pasting together URL and year_day
url <- paste0(API_URL, year_day)
print(url)[1] "https://nrt3.modaps.eosdis.nasa.gov/api/v2/content/details?products=MCDWD_L3_F3_NRT&archiveSets=61&temporalRanges=2024-102"
Loading the Data
NASA earthdata access requires a nasa username and token. How to generate User Token.
Access the NASA Earthdata with the GET function. Replace USER_TOKEN with the token you generated:
token <- "USER_TOKEN"api_key <- paste("Bearer", token)Check the response status from the GET function:
responseResponse [https://nrt3.modaps.eosdis.nasa.gov/api/v2/content/details?products=MCDWD_L3_F3_NRT&archiveSets=61&temporalRanges=2024-102]
Date: 2024-04-13 14:36
Status: 200
Content-Type: application/json;charset=UTF-8
Size: 113 kB
Out of the response from the server, we’ll check if the response was a success with if (http_status(response)$category == "Success"). If this statement is true, then the content will be assigned to the variable data in JSON format, which is then parsed to a data frame using data_parsed <- jsonlite::fromJSON(data). The data frame contains data_parsed$content, a column with content. We filter the content by tile code using the command content_items <- data_parsed$content[grepl(tile_code, data_parsed$content$name, ignore.case = TRUE), ] and add the results to a data frame.
if (httr::http_status(response)$category == "Success") {
# Read the JSON content into a data frame
df <- httr::content(response, as = "parsed", simplifyVector = TRUE)
df <- df$content
} else {
print("Request failed with status code", httr::http_status(response)$status_code)
}
names(df) [1] "archiveSets" "cksum" "collections" "dataDay"
[5] "downloadsLink" "fileId" "md5sum" "mtime"
[9] "name" "products" "resourceType" "self"
[13] "size"
Search the Data Frame and subset the rows that contain tile_code in the downloadsLink column.
# Subset rows where the downloadsLink column contains the tile code
subset_df <- df[grepl(tile_code, df$downloadsLink), ]
subset_df archiveSets cksum collections dataDay
116 61 826602906 modis-nrt-c6.1 2024-102 = 2024-04-11
downloadsLink
116 https://nrt3.modaps.eosdis.nasa.gov/api/v2/content/archives/MCDWD_L3_F3_NRT.A2024102.h05v05.061.tif
fileId md5sum mtime
116 2200473883 6d7939907f42817d4253ea79dc7c7113 1712891285
name products resourceType
116 MCDWD_L3_F3_NRT.A2024102.h05v05.061.tif MCDWD_L3_F3_NRT File
self size
116 /api/v2/content/details/MCDWD_L3_F3_NRT.A2024102.h05v05.061.tif 780531
If there is only 1 row, select the string ‘downloadsLink’ column:
download_link <- subset_df$downloadsLink
print(download_link)[1] "https://nrt3.modaps.eosdis.nasa.gov/api/v2/content/archives/MCDWD_L3_F3_NRT.A2024102.h05v05.061.tif"
# Make the GET request to the download link with the headers
# response2 <- GET(download_link, add_headers(headers))# response2Read the Data
Use the “read_stars()” function from the “stars” R Library to read the geoTiff raster. The raster is assigned to the “raster_df” variable. This is a web-derived layer that is in the Geographic Coordinate System (GCS) WGS84 (EPSG number 4326). We can assign the Coordinate Reference System (CRS) to the stars object:
raster_df <- stars::read_stars(download_link)
sf::st_crs(raster_df) <- sf::st_crs(4326)Set the Coordinate Reference System (CRS) to a new raster “my_raster” to plot it in a map. For example, Web Mercator EPSG:3857. Use the st_transform() function:
# raster_df4326 <- sf::st_transform(raster_df, 4326)
# raster_df5070 <- sf::st_transform(raster_df, 5070)
# raster_df32610 <- sf::st_transform(raster_df, 32610)
# raster_warp <- st_transform(raster_df, crs = 32610, resampling_method = "bilinear")
# raster_reprojected <- st_warp(raster_df, crs = 3857, use_gdal=FALSE, method = "near")Now the raster data should be stored as a variable “my_raster” with the CRS set to Web Mercator EPSG:3857
## Visualizing NRT Flood Data
Plot the raster to quickly view it. downsample allows faster rendering for viewing:
plot(raster_df, downsample=30)Create NRT Flood Plot with Classification
Refer to the MODIS NRT Global Flood Product User Guide for more information.
NRT Flood data has 5 classifications:
| Code | Definition |
|---|---|
| 0 | No Water |
| 1 | Surface Water |
| 2 | Recurring flood4 |
| 3 | Flood (unusual) |
| 255 | Insufficient data |
To view the data in this classification, we’ll need to create a classified legend; however, the NRT Flood data is stored in decimal numbers (aka floating-point). Create class breaks dividing the data by the following breaks, and corresponding colors and labels:
class_breaks <- c(-Inf, 0.1, 1.1, 2.1, 3.1)
colors <- c( "gray", "blue", "yellow", "red")
labels = c("0: No Water", "1: Surface Water", "2: Recurring flood", "3: Flood (unusual)")Add a title for the plot that includes the year, day of year, and tile code:
title = paste("Near Real-Time Flood F3", year_day, tile_code)Generate a basemap from Esri Imagery
To generate a basemap that shows the location of our raster, we must first create a bounding box to match raster_df.
# bbox <- sf::st_bbox(raster_df)
# Convert the bbox to an sf object with EPSG:5070 CRS
#bbox <- st_as_sfc(bbox, crs = st_crs("EPSG:5070"))
#bbox <- st_warp(bbox, crs = 3857, method = "bilinear", use_gdal=FALSE)
# Transform the bbox to EPSG:4326
# bbox <- st_transform(bbox, crs = st_crs("EPSG:3857"))
# bbox <- sf::st_bbox(bbox)The basemap_stars() function from the stars library allows us to access Esri imagery layers. We choose “world_imagery” as our background and assign it to the object bm_m.
bm_m <- basemaps::basemap_stars(raster_df, map_service = "esri", map_type = "world_imagery")Loading basemap 'world_imagery' from map service 'esri'...
#bm_m <- st_transform(bm_m, crs = st_crs("EPSG:5070"))The st_rgb function lets us turn the RGB stars item into a single image
bm_m <- stars::st_rgb(bm_m)
bm_m <- sf::st_transform(bm_m, 4326)#plot(bbox, downsample=5)Plot basemap and NRT Flood data
Generate a plot from the tmap library using the tm_shape() function. We will plot the basemap and the raster_df items.
## tmap mode set to "plot"
tmap::tmap_mode("plot")
## tmap mode can also be set to "view"
#tmap_mode("view")
#create an object the plots the basemap and the NRT flood raster
#with the tmap library, call the tm_shape() function for the basemap
tm_plot <- tmap::tm_shape(bm_m)+
tmap::tm_raster()+
#create a new tmap shape for the NRT flood raster with style as "cat," meaning categorical.
tmap::tm_shape(raster_df, style="cat")+
#add the classification styling to the raster
tmap::tm_raster( palette = c(colors),
title = title,
breaks = class_breaks,
labels = labels )+
#style the plot
tmap::tm_layout(legend.outside = TRUE) +
tmap::tm_graticules(lines=FALSE)
#view Plot
tm_plotView the plot:
To observe a location closer, we can create a new bounding box using latitude and longitude values, clip the data and replot on a map.
Select from the map four corners in degrees including North/South, East/West information. We use these coordinates to create a matrix of points that represent four corners:
# Define the NWES coordinates
north <- 40 #negative values are used for South
south <- 36 #negative values are used for south
west <- -124 #negative numbers are used for West
east <- -120 #negative numbers are used for West
# Create a matrix with the corner coordinates
# corners <- matrix(c(west, south, east, south, east, north, west, north), ncol = 2, byrow = TRUE)
# Create a bounding box
bbox_subset <- sf::st_bbox(c(xmin = west, ymin = south, xmax = east, ymax = north), crs = 4326)We can create a bounding box from these corners. The corners are first placed in a Geographic Coordinate System (GCS) WGS84:
# Create a SpatialPolygons object representing a bounding box
# bbox_subset <- sp::SpatialPolygons(list(sp::Polygons(list(sp::Polygon(corners)), ID = "bbox")), proj4string = sp::CRS("+proj=longlat +datum=WGS84"))
# bbox_subset <- sp::SpatialPolygons(
# list(sp::Polygons(
# list(sp::Polygon(corners)), ID = "bbox")),
# proj4string = sp::CRS("+init=epsg:4326"))
#bbox_subset <- sp::spTransform(bbox_subset, sp::CRS("+init=epsg:3857"))
# bbox_subset <- sf::st_as_sfc(bbox_subset)
#bbox_subset <- sf::st_bbox(raster_dfa)
#bbox_subset <- sf::st_as_sfc(bbox_subset)
# polygon <- st_transform(polygon, 32610)
# bbox_subset <- st_transform(bbox_subset, 3857)
# bbox_subset <- sf::st_bbox(bbox_subset)Finally, these points are projected to a Projected Coordinate System (PCS) 3857 to match our raster:
# Transform to projected coordinate system (e.g., EPSG:3857)
# bbox_subset <- sp::spTransform(bbox_subset, sp::CRS("+init=epsg:3857"))
# bbox_poly <- sf::st_as_sfc(bbox_subset)We redo the same process as above to plot the data with a basemap but with a different bounding box:
#generate a new basemap
bm_m <- basemaps::basemap_stars(bbox_subset, map_service = "esri", map_type = "world_imagery")Loading basemap 'world_imagery' from map service 'esri'...
#combine RGB bands of the bsemap
bm_m <- stars::st_rgb(bm_m)
bm_m <- sf::st_transform(bm_m, 4326)## tmap mode set to "plot"
tmap::tmap_mode("plot")
## tmap mode can also be set to "view"
#tmap_mode("view")
#create an object the plots the basemap and the NRT flood raster
#with the tmap library, call the tm_shape() function for the basemap
tm_plot <- tmap::tm_shape(bm_m)+
tmap::tm_raster()+
#create a new tmap shape for the NRT flood raster with style as "cat," meaning categorical.
tmap::tm_shape(raster_df, style="cat")+
#add the classification styling to the raster
tmap::tm_raster( palette = c(colors),
title = title,
breaks = class_breaks,
labels = labels )+
#style the plot
tmap::tm_layout(legend.outside = TRUE) +
tmap::tm_graticules(lines=FALSE)
#View the plot:
tm_plotZonal Statistics fo Flood Zones
The NRT flood data can be compared to the Cropland Data Layer (CDL), which provides agricultural categories based on the Farm Service Agency (FSA) Common Land Unit (CLU) Program and is produced by the U.S. Department of Agriculture National Agricultural Statistics Service (NASS)(USDA-NASS 2023).
To quantify how many acres of crop lands may be affected by the flooding identified in the NRT Flood data, we can explore the dataset by using the Cropland Collaborative Research Outcomes System (CroplandCROS), and we can download the data from the NASS website at https://www.nass.usda.gov/Research_and_Science/Cropland/Release/index.php
Download the latest CDL year of data available from the link above.
For this part of the exercise, we will use the package stars, discussed in the previous lesson, and the function read_stars() to read the CDL raster as a stars object.
#Read CDL GeoTIFF
cdl<- stars::read_stars("2022_30m_cdls.tif")
plot(cdl, downsample=100)This raster is provided with a 30 meter resolution for the entire contiguous U.S.! Additionally the CRS is the North American Datum of 1983 (NAD83) / Albers Conical Equal Area (AEA) projection. We can subset this raster with the NRT flood raster, but we must first crop it with the bounding box bbox_subset we created previously, and warp the raster from the CRS EPSG:4326 to EPSG:5070:
#subset the NRT Floor raster with the bounding box
raster_sub <- raster_df[bbox_subset]
#warp the raster NRT flood raster to match the CDL raster CRS.
raster_sub <- stars::st_warp(raster_sub, crs=5070, use_gdal=FALSE,method = "near")
#subset CDL raster with the subset NRT flood raster
cdl_sub <- cdl[raster_sub]
#because of the high resolution, a stars proxy object was made
#make a stars object from a stars proxy object to directly read the data
cdl_sub <- stars::st_as_stars(cdl_sub)
plot(cdl_sub, downsample=100)# # Create a bounding box object using st_bbox()
# bbox <- st_bbox(c(xmin=west, ymin=south, xmax=east, ymax=north), crs = 4326)
# # Convert the bounding box to a simple feature geometry (polygon)
# polygon <- st_as_sfc(bbox_subset)
# logical <- as.logical(polygon)
# ras_ras <- as(raster_df, "Raster")
# # Transform the polygon to CRS 4326 (WGS84)
# #polygon_4326 <- st_transform(polygon, crs = 4326)
# #subset raster by bounding box
# raster_warp <- st_warp(raster_df, use_gdal = FALSE, dest=raster_df)
# raster_dfd <- stars::st_within(raster_df,bbox_subset)
# #subset raster by bounding box
# raster_dfd <- raster_warp[polygon]
# raster_dfdc <- st_crop(raster_df, polygon)
# bbox_subset <- sf::st_bbox(bbox_subset)
# stars::st_set_bbox(raster_dfd, bbox_subset)
# st_test <- raster_dfd[raster_dfd!=NA]
# st_set_bbox(raster_dfd, bbox_subset)
# stars::sf_set_bbox(raster_dfd, bbox_subset)
# # Update the extent of raster_df to reflect the new bounding box
# extent(raster_dfd) <- extent(bbox_subset)
# # Plot the raster
# plot(cdl_4326, downsample=30, reset=FALSE)
# #create an object the plots the basemap and the NRT flood raster
# #with the tmap library, call the tm_shape() function for the basemap
# tm_plot <- tmap::tm_shape(raster_df, style="cat")+
# #add the classification styling to the raster
# tmap::tm_raster( palette = c(colors),
# title = title,
# breaks = class_breaks,
# labels = labels )+
# tmap::tm_shape(polygon)+
# tm_fill("red", alpha = 0.3) +
# tm_borders(lwd = 2, col = "red") +
# #style the plot
# tmap::tm_layout(legend.outside = TRUE) +
# tmap::tm_graticules(lines=FALSE)
# tm_plot
# st_crs(raster_df)# bbox_subset <- SpatialPolygons(list(Polygons(list(Polygon(corners)), ID = "bbox")),
# proj4string = CRS("+proj=longlat +datum=WGS84"))
# raster_dfd <- st_crop(raster_df,bbox_subset)
# plot(raster_df, downsample=30)We can subset stars objects with other stars objects if they are the same coordinate reference system (CRS). We will first subset the NRT Flood raster and project the data into the same CRS that the CDL data has.
# #subset raster by bounding box
# raster_df_subset <- raster_df[bbox_subset]
# #transform to a different CRS
# raster_df_subset <- st_transform(raster_df_subset, crs = st_crs(cdl))# plot(raster_df_subset, downsample=50)We are only interested in the areas that are showing as Flooded (unusual), therefore, we want to exclude other variables. We make a copy of the raster_sub variable and set variables that are not 3 as NA.
#make copy of variable
raster3 <- raster_sub
#set variables as NA
raster3[raster3 != 3] <- NA
#single break for plotting
breaks3 <- c(0,3)
plot(raster3, breaks=breaks3, col="red",downsample=20)Now that we have only the flooded areas from the NRT Flood data, we can subset the CDL data.
#cdl was raster proxy, so we convert it to a general stars object.
# cdl_sub <- stars::st_as_stars(cdl)
#subset the CDL raster where unusual flooding occurred
cdl_sub3 <- cdl_sub[raster3==3]
plot(cdl_sub3,downsample=100)We want to create a table out the remaining CDL raster data, but we first have to extract it from the stars object and convert it to a matrix. The matrix is then converted to a table.
# Convert the stars object to a matrix
cdl_matrix <- as.matrix(cdl_sub3)
# Count the number of pixels for each category
cdl_counts <- table(cdl_matrix)
#Sort the `cdl_counts` table by descending order.
cdl_counts<- sort(cdl_counts, decreasing = TRUE)Select the top 10 CDL categories counted.
top_10 <- cdl_counts[1:10]
#print top 10
print(top_10)cdl_matrix
Evergreen Forest Shrubland Grassland/Pasture
29620 27654 17615
Almonds Developed/Open Space Mixed Forest
4403 3490 2911
Fallow/Idle Cropland Developed/Med Intensity Developed/Low Intensity
2612 2493 2083
Grapes
2046
Turn the top 10 table into a dataframe. This will allow us to more easily handle the dataframe table and data.
dataplot <- as.data.frame(top_10)According to the NASS CDL data documentation, each of the CDL’s pixels represents 30 square meters. Additionally, a hectare is 10,000 meters. We can calculate the hectares of each CDL category by first multiplying the count of each category by 30 and dividing by 10,000.
# Calculate the area for each row
dataplot$area <- dataplot$Freq * 30 / 10000Once the are is calculated, we can plot a bar graph to compare the top 10 CDL Categories found in the NRT Flood zone.
library(ggplot2)
title = paste("Hectares of Cropland Category under flood, day", year_day)
max_value <- max(dataplot$area)+10
plt <- ggplot(dataplot, aes(x = area, y = cdl_matrix)) +
geom_bar(stat = "identity", fill = "skyblue") +
geom_vline(xintercept = seq(0, max_value, by = 5), color = "gray", linetype = "dashed") +
labs(title = title, x = "Hectares (ha)", y = "Categories") +
theme_minimal() +
theme(axis.text.y = element_text(hjust = 1, size = 20), # Adjust size of y-axis labels
axis.text.x = element_text(size = 20), # Adjust size of x-axis labels
axis.title = element_text(size = 20), # Adjust size of axis titles
plot.title = element_text(size = 20), # Adjust size of plot title
axis.line = element_line(size = 1), # Adjust size of axis lines
axis.ticks = element_line(size = 1), # Adjust size of axis ticks
panel.grid.major = element_blank(), # Remove major gridlines
panel.grid.minor = element_blank(), # Remove minor gridlines
plot.background = element_rect(fill = "white"), # Set plot background color
panel.background = element_rect(fill = "white"), # Set panel background color
panel.border = element_rect(color = "black", fill = NA, size = 0.5)) + # Set panel border
geom_text(aes(label = round(area,1)), hjust = 0.5, size = 6, color = "black") +
xlim(0, max_value) # Adjust x-axis limits # Adjust size of text labels
pltCongratulations! Now you should be able to:
Navigate the LANCE data website and determine what data is available.
Select a tile and date to download NRT data.
Create a GET HTTP request to download near-real-time data.
Plot on a map and classify raster data to determine areas with unusual flooding.
Lesson 4
In this lesson we explored the LANCE MODIS Near-Rear-Time (NRT) Flood dataset. In our next lesson we will think of water at the local level and focuse on New Nork State School Drinking Water datasets .
Lesson 4: New York Sate School Water Quality: Exposure to Lead